package com.lankystar.sos.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * 消息表
 * @author SYX
 *
 */
@Entity
@Table(name="sos_message")
public class Message implements Serializable{

	private static final long serialVersionUID = 1L;
	private int mgsId;
	private String message;
	private Date time;
	private String genre;//类型  求救者、施救者
	private User user;
	private Room room;
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public int getMgsId() {
		return mgsId;
	}
	public void setMgsId(int mgsId) {
		this.mgsId = mgsId;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	@Temporal(TemporalType.TIMESTAMP)
	public Date getTime() {
		return time;
	}
	public void setTime(Date time) {
		this.time = time;
	}
	public String getGenre() {
		return genre;
	}
	public void setGenre(String genre) {
		this.genre = genre;
	}
	@ManyToOne
	@JoinColumn(name = "user_Id")
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	@ManyToOne
	@JoinColumn(name = "room_Id")
	public Room getRoom() {
		return room;
	}
	public void setRoom(Room room) {
		this.room = room;
	}
	
	
	
}
